#ifndef _DISPLAYABLE_CONTAINER_H_
#define _DISPLAYABLE_CONTAINER_H_

#ifdef _WIN32
#pragma once
#endif

/**
 * 04/03/2012 - Steven Hartin - Original Creation
 * 
 * The functionality of this library is simply to keep a reference to all the
 * displayable objects on the screen. This is to allow a single render function
 * to render all the displayable object which makes it easier for us.
 */

#include <vector>
#include <algorithm>
#include <string>

#include "XAnimator_lib.h"

#include "displayable.h"
#include "meshcontainer.h"
#include "mesh.h"
#include "devicemanager.h"

using std::vector;
using std::string;

class CDisplayableContainer
{
public:
    static CDisplayableContainer* getInstance();

    void insertDisplayable(CDisplayable *pDisplayable);
    bool removeDisplayable(CDisplayable *pDisplayable);

    CDisplayable *createDisplayable();
    CDisplayable *createDisplayable(CMesh *pMesh);
    CDisplayable *createDisplayable(const string &szMeshKey);

    void clearDisplayables();

    void render();

    IXAnimator *getAnimatorObject() const;

private:
    CDisplayableContainer();
    CDisplayableContainer(const CDisplayableContainer &rhs) {}
    CDisplayableContainer &operator=(CDisplayableContainer &rhs) {}
    ~CDisplayableContainer();

    vector<CDisplayable*> m_arrDisplayables;
    IXAnimator *m_pAnimator;
};

#endif